<%@ page language="java" contentType="text/html; charset=UTF-8"	 pageEncoding="UTF-8"%>
<%@ include file="../include/laypublic.jsp"%>
<!DOCTYPE html>
<html>
<head>
  <title>决策新增</title>
</head>
<style>
	.fieldset{
		margin-top: 5px;
		margin-bottom: 0px
	}
	.layui-legend{
		background-color:#5fb878;
		font-size:15px !important;
		width:140px;
	}
	.layui-form-item {
	    margin-bottom: 5px;
	    clear: both;
	    *zoom: 1;
	}
	.layui-form-label{width: 180px;}
	.right{
		float:right;
	}
	.width106{
		width:106px;
	}
	.width98{
		width:98px;
	}
	.width60{
		width:60px;
	}
</style>
<body>
<div class="layui-fluid">
    <div class="layui-card">
	    <div class="layui-tab-item layui-show">
	    	<div style="padding-top:15px;">&nbsp;</div>
			<form class="layui-form" id="addInfo_form" lay-filter="add_info_from">
				<fieldset class="layui-elem-field layui-field-title fieldset"  id="baseInfo">
				  <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目基础信息  ></legend>
				  <div style="margin-top:20px">
				  	<div class="layui-form-item">
				  		<div class="layui-inline">
					      	<label class="layui-form-label">项目名称</label>
					      	<div class="layui-input-inline">
					        	<select name="id" lay-filter="add_select_proId" lay-verify="required" lay-search>
		              				<option value="">请选择-项目名称</option>
				              		<c:if test="${not empty inquiryPros }">
				              			<c:forEach items="${inquiryPros}" var="inquiryPro">
				              				<option value="${inquiryPro.id }">${inquiryPro.proName }</option>
					            		</c:forEach>
				              		</c:if>
				              	</select>
						        <input type="hidden" name="proName">
					      	</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">项目类型</label>
				      		<div class="layui-input-inline">
						        <input type="text" value="PPP项目" style="border:0px;" readonly="readonly" class="layui-input">
						        <input type="hidden" name="types" value="1">
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">项目编号</label>
				      		<div class="layui-input-inline">
						        <input type="text" name="proCode" style="border:0px;" readonly="readonly" class="layui-input">
				      		</div>
					    </div>
				    </div>
				  	<div class="layui-form-item">
				  		<div class="layui-inline">
					      	<label class="layui-form-label">申请公司</label>
					      	<div class="layui-input-inline">
					      		<input type="hidden" name="deciOrgId" value="${bindOrgId}">
								<input type="text" value="${bindOrgName}" style="border:0px;width:220px" readonly="readonly" class="layui-input">
					      	</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">申请部门</label>
				      		<div class="layui-input-inline">
				      			<input type="hidden" name="deciDeptId" value="${bindDeptId}">
								<input type="text" value="${bindDeptName}" style="border:0px;" readonly="readonly" class="layui-input">
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">申请人</label>
				      		<div class="layui-input-inline">
				        		<input type="hidden" name="setupHrStaffApplyId" readonly="readonly" value="${SESSION_KEY_USER_DETAIL.hrStaffId }">
				        		<input type="text" name="setupStaffName" value="${SESSION_KEY_USER_DETAIL.realName }" readonly="readonly" style="border:0px" class="layui-input">
				      		</div>
					    </div>
				    </div>
				  	<div class="layui-form-item">
				  		 <div class="layui-inline">
					    	<label class="layui-form-label">项目城市</label>
				      		<div class="layui-input-inline">
				        		<infopub:combox entireName="-项目城市" name="sgCityId" layVerify="required" valueField="id" textField="cityName" serviceBeanId="citySurveyServiceImpl" ></infopub:combox>
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">一般公共预算收入（亿元）</label>
				      		<div class="layui-input-inline">
					        	<input type="text" name="pubIncome" readonly="readonly" style="border:0px" class="layui-input">
					       	</div>
					    </div>
				  		<div class="layui-inline">
					      	<label class="layui-form-label">年度PPP项目占一般公共预算支出比例比(%)</label>
					      	<div class="layui-input-inline">
					        	<input type="text" name="pppPercent" readonly="readonly" style="border:0px" class="layui-input">
					      	</div>
					    </div>
				    </div>
				  	<div class="layui-form-item">
				  		<div class="layui-inline">
					    	<label class="layui-form-label">营销经理</label>
				      		<div class="layui-input-inline">
				        		<input type="hidden" name="hrStaffMktId">
				        		<input type="hidden" name="signupLead">
				        		<input type="text" name="hrStaffName" readonly="readonly" style="border:0px" class="layui-input">
				      		</div>
					    </div>
				  		<div class="layui-inline">
					    	<label class="layui-form-label">入库情况</label>
				      		<div class="layui-input-inline">
					      		<select name="isInStore" lay-verify="required">
					      			<option value="">请选择-入库情况</option>
					      			<option value="0">未入库</option>
					      			<option value="1">已入库</option>
								</select>
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">意向申请会议日期</label>
				      		<div class="layui-input-inline">
					      		<input type="text" class="layui-input" id="sent-laydate-meeting" name="meetingDate" lay-verify="required" readonly placeholder="意向申请会议日期">
				      		</div>
					    </div>
		    		</div>
				  	<div class="layui-form-item">
				  		<div class="layui-inline">
					      	<label class="layui-form-label">项目简介</label>
					      	<div class="layui-input-inline">
					        	<textarea name="proRemarks" readonly="readonly" maxlength="500" class="layui-textarea" style="width:899px;height:90px;"></textarea>
					      	</div>
			    		</div>
		    		</div>
		  		</div>
			</fieldset>
			<fieldset class="layui-elem-field layui-field-title fieldset"  id="investInfo">
		  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">决策投标信息 ></legend>
			  	<div style="margin-top:20px">
			  		<div class="layui-form-item">
					    <div class="layui-inline">
					    	<label class="layui-form-label">投标保证金（万元）</label>
				      		<div class="layui-input-inline">
					      		<input type="text" name="deciBondMoney" lay-verify="required|floatAmount" placeholder="请输入" maxlength="11" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">投标保证金截止日</label>
				      		<div class="layui-input-inline">
					      		<input type="text" class="layui-input" id="sent-laydate-bondend" name="deciBondEndDate" lay-verify="required" readonly placeholder="决策截止日期">
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">投标截止日期</label>
				      		<div class="layui-input-inline">
					      		<input type="text" class="layui-input" id="sent-laydate-bidend" name="bidEndDate" lay-verify="required" readonly placeholder="投标保证金截止日">
				      		</div>
					    </div>
					</div>
			  	</div>
			</fieldset>
			<fieldset class="layui-elem-field layui-field-title fieldset"  id="careerInfo">
		  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目合作方  ></legend>
			  	<div style="margin-top:20px">
			  		<div class="layui-form-item">
					    <div class="layui-inline">
					    	<label class="layui-form-label">项目渠道</label>
				      		<div class="layui-input-inline">
					      		<select name="fromChannel" lay-verify="required" lay-filter="add_selectFromChannel">
					      			<option value="">请选择-项目渠道</option>
					      			<option value="1">自行获取</option>
					      			<option value="2">居间合作</option>
								</select>
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">实施机构</label>
				      		<div class="layui-input-inline">
					      		<input type="text" name="carryOrg" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">招标代理机构</label>
				      		<div class="layui-input-inline">
					      		<input type="text" name="bidAgent" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">
				      		</div>
					    </div>
				    </div>
				    <div class="layui-form-item">
				    	<div class="layui-inline">
					    	<label class="layui-form-label">预计居间人费用（万元）</label>
				      		<div class="layui-input-inline">
					      		<input type="text" name="linkPowerCost" lay-verify="required|floatAmount" placeholder="请输入" maxlength="11" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">占建安费用比例（%）</label>
				      		<div class="layui-input-inline">
					      		<input type="text" name="ofCaePercent" maxlength="11" lay-verify="required|floatNumber" placeholder="请输入" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
				      		</div>
					    </div>
					    <div class="layui-inline" id="linkPowerDiv" style="display:none">
					    	<label class="layui-form-label">居间方</label>
				      		<div class="layui-input-inline">
					      		<input type="text" name="linkPower" id="linkPower" maxlength="100" autocomplete="off" class="layui-input">
				      		</div>
					    </div>
				    </div>
			  	</div>
			  	<fieldset class="layui-elem-field layui-field-title fieldset"  id="customerFile">
			  		<legend style="margin-left:40px;font-size:15px;font-weight:bold;">联合体单位  ></legend>
				  	<div style="margin-top:20px" id="coopDiv">
				  		<div class="layui-form-item" id="linkRow1">
				  			<div class="layui-inline width106">
						    	<p class="right">单位<label>1</label>：</p>
						    </div>
						    <div class="layui-inline">
						    	<label class="layui-form-label width60">单位名称</label>
					      		<div class="layui-input-inline" id="sgCoopSelect">
						      		<select name="sgCoopId" lay-search>
						      			<option value="">请选择-单位名称</option>
						      			<c:if test="${not empty coopInfos }">
					              			<c:forEach items="${coopInfos}" var="coop">
					              				<option value="${coop.id }">${coop.coopName }</option>
						            		</c:forEach>
					              		</c:if>
									</select>
					      		</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label">单位作用</label>
						      	<div class="layui-input-inline" id="coopEffectSelect">
						      		<select name="coopEffect">
						      			<option value="">请选择-单位作用</option>
			              				<option value="1">关系维护</option>
			              				<option value="2">资质补充</option>
			              				<option value="3">资金投入</option>
			              				<option value="4">运营合作</option>
									</select>
						      	</div>
						    </div>
						    <div class="layui-inline">
						    	<button type="button" class="layui-btn layui-btn-sm" id="addLinkBtn1" onclick="addRow(this);"><i class="layui-icon">&#xe654;</i></button>
						    </div>
					    </div>
					</div>
			  	</fieldset>
				</fieldset>
				<fieldset class="layui-elem-field layui-field-title fieldset" id="loanInfo">
			  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目子项  ></legend>
				  	<div style="margin-top:20px">
				  		<div class="layui-form-item">
						    <div class="layui-inline">
						    	<label class="layui-form-label">合作周期（年）</label>
					      		<div class="layui-input-inline">
						      		<input type="text" name="workYears" value="0" readonly="readonly" style="border:0px" class="layui-input">
					      		</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label">建设周期（年）</label>
						      	<div class="layui-input-inline">
						        	<input type="text" name="buildYears" value="0" readonly="readonly" style="border:0px" class="layui-input">
						      	</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label">运营周期（年）</label>
						      	<div class="layui-input-inline">
						        	<input type="text" name="omYears" value="0" readonly="readonly" style="border:0px" class="layui-input">
						      	</div>
						    </div>
					    </div>
					    <fieldset class="layui-elem-field layui-field-title fieldset"  id="customerFile">
					  		<legend style="margin-left:40px;font-size:15px;font-weight:bold;">项目子项  ></legend>
						  	<div style="margin-top:20px" id="subDiv">
						    	<div id="commRow1">
							  		<div class="layui-form-item">
							    		<div class="layui-inline width106">
									    	<p class="right">子项<label>1</label>：</p>
									    	<input type="hidden" name="orderIdx" value="1"/>
									    </div>
									    <div class="layui-inline">
									    	<label class="layui-form-label width60">子项名称</label>
								      		<div class="layui-input-inline" style="width:120px;">
									      		<input type="text" name="subName" value="" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">
								      		</div>
									    </div>
									    <div class="layui-inline">
									      	<label class="layui-form-label width98">合作周期（年）</label>
									      	<div class="layui-input-inline" style="width:98px;">
									        	<input type="text" name="subWorkYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">
									      	</div>
									    </div>
									    <div class="layui-inline">
									      	<label class="layui-form-label width98">建设周期（年）</label>
									      	<div class="layui-input-inline" style="width:98px;">
									        	<input type="text" name="subBuildYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">
									      	</div>
									    </div>
									    <div class="layui-inline">
									      	<label class="layui-form-label width98">运营周期（年）</label>
									      	<div class="layui-input-inline" style="width:98px;">
									        	<input type="text" name="subOmYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">
									      	</div>
									    </div>
									    <div class="layui-inline">
									    	<button type="button" class="layui-btn layui-btn-sm" id="addCommBtn1" onclick="addCommRow(this)"><i class="layui-icon">&#xe654;</i></button>
									    	<button type="button" class="layui-btn layui-btn-sm" style="display:none" id="delCommBtn1" onclick="deleteCommRow(1)"><i class="layui-icon">&#xe640;</i></button>
									    </div>
								    </div>
					    		</div>
						  	</div>
						</fieldset>
					</div>
				</fieldset>
				<fieldset class="layui-elem-field layui-field-title fieldset" id="houseInfo">
			  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目资金信息  ></legend>
				  	<div style="margin-top:20px">
				  		<div class="layui-form-item">
						    <div class="layui-inline">
						    	<label class="layui-form-label">资本金数额（万元）</label>
					      		<div class="layui-input-inline">
						      		<input type="text" name="capitalFund" lay-verify="required|floatAmount" placeholder="请输入" maxlength="11" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
					      		</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label">资本金比例（%）</label>
						      	<div class="layui-input-inline">
						        	<input type="text" name="capitalPercent" maxlength="11" lay-verify="required|floatNumber" placeholder="请输入" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
						      	</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label">我方股权出资金额（万元）</label>
						      	<div class="layui-input-inline">
						        	<input type="text" name="stockFund" lay-verify="required|floatAmount" placeholder="请输入" maxlength="11" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
						      	</div>
						    </div>
					    </div>
					    <div class="layui-form-item">
						    <div class="layui-inline">
						    	<label class="layui-form-label">我方股权比例（%）</label>
					      		<div class="layui-input-inline">
						      		<input type="text" name="stockPercent" maxlength="11" lay-verify="required|floatNumber" placeholder="请输入" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
					      		</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label">总投资额（万元）</label>
						      	<div class="layui-input-inline">
						        	<input type="text" name="sumAmount" id="sumAmount" style="border:0px;" readonly="readonly" autocomplete="off" class="layui-input">
						      	</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label">建安工程总费用（万元）</label>
						      	<div class="layui-input-inline">
						        	<input type="text" name="sumCae" id="sumCae" style="border:0px;" readonly="readonly" autocomplete="off" class="layui-input">
						      	</div>
						    </div>
					    </div>
					    <fieldset class="layui-elem-field layui-field-title fieldset"  id="creditInfo">
			  				<legend style="margin-left:40px;font-size:15px;font-weight:bold;">投资构成  ></legend>
				  			<div style="margin-top:20px">
				  				<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">建安工程费（万元）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="costCae" id="costCae" maxlength="11" lay-verify="required|floatAmount" onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								      	<label class="layui-form-label">设备购置工程费（万元）</label>
								      	<div class="layui-input-inline">
								        	<input type="text" name="deviceCost" id="deviceCost" maxlength="11" lay-verify="required|floatAmount" onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off" class="layui-input">
								      	</div>
								    </div>
								    <div class="layui-inline">
								      	<label class="layui-form-label">预备费（万元）</label>
								      	<div class="layui-input-inline">
								        	<input type="text" name="inReadyCost" id="inReadyCost" maxlength="11" lay-verify="required|floatAmount" onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off" class="layui-input">
								      	</div>
								    </div>
							    </div>
				  				<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">建设期利息（万元）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="periodInterest" id="periodInterest" maxlength="11" lay-verify="required|floatAmount" onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								      	<label class="layui-form-label">铺底流动资金（万元）</label>
								      	<div class="layui-input-inline">
								        	<input type="text" name="fluidCapital" id="fluidCapital" maxlength="11" lay-verify="required|floatAmount" onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off" class="layui-input">
								      	</div>
								    </div>
								    <div class="layui-inline">
								      	<label class="layui-form-label">工程建设其他费（万元）</label>
								      	<div class="layui-input-inline">
								        	<input type="text" name="otherCost" id="otherCost" maxlength="11" lay-verify="required|floatAmount" onblur="calcSumAmount();arabiaToCN(this,2);" autocomplete="off" class="layui-input">
								      	</div>
								    </div>
							    </div>
				  				<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">其中：征地拆迁费（万元）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="moveOutCost" maxlength="11" lay-verify="required|floatAmount" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
							      		</div>
								    </div>
							    </div>
				  			</div>
				  		</fieldset>
					    <fieldset class="layui-elem-field layui-field-title fieldset"  id="creditInfo">
			  				<legend style="margin-left:40px;font-size:15px;font-weight:bold;">回报机制 ></legend>
				  			<div style="margin-top:20px">
				  				<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">回报机制</label>
							      		<div class="layui-input-inline">
								      		<input type="checkbox" name="backMech" value="1" title="政府付费" lay-skin="primary">
							      		</div>
							      		<div class="layui-input-inline">
											<input type="checkbox" name="backMech" value="2" title="可行性缺口补助" lay-skin="primary"> 
							      		</div>
							      		<div class="layui-input-inline">
											<input type="checkbox" name="backMech" value="3" title="使用者付费" lay-skin="primary"> 
							      		</div>
								    </div>
							    </div>
				  			</div>
				  		</fieldset>
					    <fieldset class="layui-elem-field layui-field-title fieldset"  id="invoteInfo">
			  				<legend style="margin-left:40px;font-size:15px;font-weight:bold;">投标报价  ></legend>
				  			<div style="margin-top:20px">
				  				<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">建安下浮率（%）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="quoteDownRate" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								    	<label class="layui-form-label">合理利润率（%）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="quoteProfitRate" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								    	<label class="layui-form-label">综合回报率（计划报价%）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="quoteMultiRate" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
							      		</div>
								    </div>
							    </div>
				  				<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">折现率（%）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="quoteDiscountRate" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
							      		</div>
								    </div>
							    </div>
							    <div id="itemDiv">
							  		<div class="layui-form-item" id="itemRow1">
							  			<div class="layui-inline width106">
									    	<p class="right">其他报价<label>1</label>：</p>
									    	<input type="hidden" name="itemOrderIdx" value="1"/>
									    </div>
									    <div class="layui-inline">
									    	<label class="layui-form-label width60">报价指标</label>
								      		<div class="layui-input-inline">
									      		<input type="text" name="itemName" maxlength="100" autocomplete="off" class="layui-input">
								      		</div>
									    </div>
									    <div class="layui-inline">
									      	<label class="layui-form-label">指标数据</label>
									      	<div class="layui-input-inline">
									      		<input type="text" name="itemPercent" maxlength="11" onblur="verify(this,'number')" autocomplete="off" class="layui-input">
									      	</div>
									    </div>
									    <div class="layui-inline">
									    	<button type="button" class="layui-btn layui-btn-sm" id="addItemBtn1" onclick="addItemRow(this);"><i class="layui-icon">&#xe654;</i></button>
									    	<button type="button" class="layui-btn layui-btn-sm" style="display:none" id="delItemBtn1" onclick="deleteItemRow(1)"><i class="layui-icon">&#xe640;</i></button>
									    </div>
								    </div>
								</div>
				  			</div>
				  		</fieldset>
					    <fieldset class="layui-elem-field layui-field-title fieldset"  id="invoteProfitInfo">
			  				<legend style="margin-left:40px;font-size:15px;font-weight:bold;">投标利润  ></legend>
				  			<div style="margin-top:20px">
				  				<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">建安利润（万元）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="caeProfit" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								    	<label class="layui-form-label">财务利润（万元）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="finProfit" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								    	<label class="layui-form-label">运营利润（万元）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="omProfit" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
							      		</div>
								    </div>
							    </div>
				  				<div class="layui-form-item">
								    <div class="layui-inline">
								    	<label class="layui-form-label">投标综合利润（万元）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="bidProfit" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								    	<label class="layui-form-label">综合利润率（%）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="multiRate" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
							      		</div>
								    </div>
								    <div class="layui-inline">
								    	<label class="layui-form-label">内部收益率（%）</label>
							      		<div class="layui-input-inline">
								      		<input type="text" name="innerRate" maxlength="11" lay-verify="required|floatNumber" autocomplete="off" onblur="isNumberAndFloat1(this);" class="layui-input">
							      		</div>
								    </div>
							    </div>
				  			</div>
				  		</fieldset>
				  	</div>
				</fieldset>
				<fieldset class="layui-elem-field layui-field-title fieldset"  id="creditInfo">
			  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目其他信息  ></legend>
				  	<div style="margin-top:20px">
				  		<div class="layui-form-item">
						    <div class="layui-inline">
						    	<label class="layui-form-label">初步融资方案（选填）</label>
					      		<div class="layui-input-inline">
						      		<textarea name="proFinPlan" maxlength="500" placeholder="请输入初步融资方案" class="layui-textarea" style="width:899px;height:90px;"></textarea>
					      		</div>
						    </div>
					    </div>
				  		<div class="layui-form-item">
						    <div class="layui-inline">
						    	<label class="layui-form-label">项目风险（选填）</label>
					      		<div class="layui-input-inline">
						      		<textarea name="proRisk" maxlength="500" placeholder="请输入项目风险" class="layui-textarea" style="width:899px;height:90px;"></textarea>
					      		</div>
						    </div>
					    </div>
				  		<div class="layui-form-item">
						    <div class="layui-inline">
						    	<label class="layui-form-label">其他说明（选填）</label>
					      		<div class="layui-input-inline">
						      		<textarea name="proOthers" maxlength="500" placeholder="请输入其他说明" class="layui-textarea" style="width:899px;height:90px;"></textarea>
					      		</div>
						    </div>
					    </div>
				  	</div>
				</fieldset>
				<fieldset class="layui-elem-field layui-field-title fieldset" >
			  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">附件信息  ></legend>
					  	<div style="margin-top:20px;">
						    <div class="layui-form-item">
							    <label class="layui-form-label" style="width:350px;">支持pdf、excel、word、图片资料，可上传多个</label>
							</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">标前承诺</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="31-upload-more">上传</button>
				                		<div class="layui-upload-list" id="31-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">居间合同</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="32-upload-more">上传</button>
				                		<div class="layui-upload-list" id="32-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">融资调研报告（选填）</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="33-upload-more">上传</button>
				                		<div class="layui-upload-list" id="33-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">运营调研报告（选填）</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="34-upload-more">上传</button>
				                		<div class="layui-upload-list" id="34-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">招商调研报告（选填）</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="35-upload-more">上传</button>
				                		<div class="layui-upload-list" id="35-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">当地PPP项目调研报告（选填）</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="36-upload-more">上传</button>
				                		<div class="layui-upload-list" id="36-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">招标文件（选填）</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="37-upload-more">上传</button>
				                		<div class="layui-upload-list" id="37-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">PPP合同范本</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="38-upload-more">上传</button>
				                		<div class="layui-upload-list" id="38-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">投资测算表（选填）</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="39-upload-more">上传</button>
				                		<div class="layui-upload-list" id="39-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
						    <div class="layui-form-item">
							    <label class="layui-form-label">其他资料（选填）</label>
							    <div class="layui-input-block">
							    	<div class="layui-upload">
						              	<button type="button" class="layui-btn" id="40-upload-more">上传</button>
				                		<div class="layui-upload-list" id="40-upload-more-list">
				                		</div>
						            </div>
							    </div>
						  	</div>
					  	</div>
				</fieldset>
				<div class="layui-form-item" style="position: fixed ! important; right: 30px; bottom:45%;z-index:10000;">
					<div class="layui-input-block">
			      		<button class="layui-btn layui-bg-blue layui-btn-normal layui-btn-lg  layui-btn-radius" type="button" lay-submit lay-filter="addInfo_form_submit" id="addInfo_form_submit">
			      		<i class="layui-icon layui-icon-ok layuiadmin-button-btn"></i>
			      		提交
			      		</button>
			      	</div>
			    </div>
			</form>
  		</div>
	</div>
</div>
  <script>
	//静态资源路径前缀
	var staticPath = '${fileHttpPre}';
	var stateJSON = <infopub:dicJson groupNo="A00010028" />;
	
  layui.config({
    base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'set', 'upload', 'element', 'laydate'], function(){
    var $ = layui.$
    ,form = layui.form
    ,element = layui.element
    ,laydate = layui.laydate
    ,upload = layui.upload;
    
    laydate.render({
	      elem: '#sent-laydate-meeting'
    });
    laydate.render({
	      elem: '#sent-laydate-bondend'
    });
    laydate.render({
	      elem: '#sent-laydate-bidend'
    });
 	// 正则校验
	form.verify({
		//验证汉字
	    CHS:[
	    	/^[\u0391-\uFFE5]+$/
	    	,'只能输入汉字'
	  	],
	  	//大于0的正整数
	  	intNumber:[
			/^[1-9]\d*$/
			,'请输入正确的数字'
	  	],
	  	//数字只能有两位小数
	  	floatNumber:[
			/^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
			,'请输入正确的数字'
	  	],
	  	//数字大于等于0，并只能有两位小数
	  	floatAmount:[
			/^([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
			//var pattern=/^((\d+\.\d*[1-9]\d{1})|(\d*[1-9]\d*\.\d{2}))$/; 
			,'请输入正确的数字'
	  	]
	});
 	
	//标前承诺
  	upload.render({
	      elem: '#31-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:31
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var deciPro = res.entity[i];
					var arr = deciPro.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#31-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+deciPro+'" id="fileAtt_'+arr[2]+'" name="fileAtt31" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//居间合同
  	upload.render({
	      elem: '#32-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:32
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#32-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt32" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//融资调研报告（选填）
  	upload.render({
	      elem: '#33-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:33
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#33-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt33" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	//运营调研报告（选填）
  	upload.render({
	      elem: '#34-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:34
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#34-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt34" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//招商调研报告（选填）
  	upload.render({
	      elem: '#35-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:35
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#35-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt35" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//当地PPP项目调研报告（选填）
  	upload.render({
	      elem: '#36-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:36
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#36-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt36" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//招标文件（选填）
  	upload.render({
	      elem: '#37-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:37
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#37-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt37" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//PPP合同范本
  	upload.render({
	      elem: '#38-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:38
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#38-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt38" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//投资测算表（选填）
  	upload.render({
	      elem: '#39-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:39
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#39-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt39" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//其他资料（选填）
  	upload.render({
	      elem: '#40-upload-more'
	      ,url: basePath + '/deciPro/uploadAtt/'
	      ,data: {
	    	  types:40
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var fileAtt = res.entity[i];
					var arr = fileAtt.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#40-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+fileAtt+'" id="fileAtt_'+arr[2]+'" name="fileAtt40" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
    
  	//项目名称select监听
    form.on('select(add_select_proId)', function(data){
    	var id = data.value;
    	if(id == null || id == ''){
    		return;
    	}
    	//获取公司下的所有部门
		$.ajax({
			type : "POST", //提交方式  
			url : "${ctx}/inquiryPro/getInquiryProById",//路径  
			data : {
				"id" :id
			},//数据，这里使用的是Json格式进行传输  
			success : function(result) {//返回数据根据结果进行相应的处理 
				if(result.flag==true){
					form.val('add_info_from',result.inquiryProVo); // 填充原值
					var inquiryPro = result.inquiryProVo;
					if(inquiryPro.fromChannel == '2'){
			    		$("#linkPower").attr("lay-verify","required");
			    		$("#linkPowerDiv").show();
					}else{
						$("#linkPower").removeAttr("lay-verify");
			    		$("#linkPowerDiv").hide();
					}
					var strBuffer = "";
					var sgCoopDiv = $("#sgCoopSelect").clone();
					var coopEffectDiv = $("#coopEffectSelect").clone();
					if(inquiryPro.inquiryProCoopVos.length == 0){
						$('#linkRow1').find('select[name=sgCoopId]').val('');
						$('#linkRow1').find('select[name=coopEffect]').val('');
						$('#delLinkBtn1').hide();
						var rowLength = $("div[id^='linkRow']").length;
						if(rowLength > 1){
							$("div[id^='linkRow']").each(function(){
								var tId = $(this).attr("id").substring(7);
								if(tId != '1'){
									$(this).remove();
								}
							});
						}
						form.render('select');
					}else 
					if(inquiryPro.inquiryProCoopVos.length == 1){
						$('#linkRow1').find('select[name=sgCoopId]').val(inquiryPro.inquiryProCoopVos[0].sgCoopId);
						$('#linkRow1').find('select[name=coopEffect]').val(inquiryPro.inquiryProCoopVos[0].coopEffect);
						$('#delLinkBtn1').hide();
						var rowLength = $("div[id^='linkRow']").length;
						if(rowLength > 1){
							$("div[id^='linkRow']").each(function(){
								var tId = $(this).attr("id").substring(7);
								if(tId != '1'){
									$(this).remove();
								}
							});
						}
						form.render('select');
					}else{
						$("div[id^='linkRow']").each(function(){
							var tId = $(this).attr("id").substring(7);
							if(tId != '1'){
								$(this).remove();
							}
						});
						layui.$.each(inquiryPro.inquiryProCoopVos, function(ind,item){
							//第一个需要先赋值
							if(ind == 0){
								$('#linkRow1').find('select[name=sgCoopId]').val(inquiryPro.inquiryProCoopVos[0].sgCoopId);
								$('#linkRow1').find('select[name=coopEffect]').val(inquiryPro.inquiryProCoopVos[0].coopEffect);
								$('#delLinkBtn1').show();
							}else{
								var i = ind + 1;
								strBuffer += '<div class="layui-form-item" id="linkRow'+i+'">';
								strBuffer += '	<div class="layui-inline width106">';
								strBuffer += '		<p class="right">单位<label>'+i+'</label>：</p>';
								strBuffer += '	</div>';
								strBuffer += '	<div class="layui-inline">';
								strBuffer += '		<label class="layui-form-label width60">单位名称</label>';
								strBuffer += '		<div class="layui-input-inline">';
								strBuffer += sgCoopDiv.html();
								strBuffer += '		</div>';
								strBuffer += '	</div>';
								strBuffer += '	<div class="layui-inline">';
						   		strBuffer += '		<label class="layui-form-label">单位作用</label>';
						   		strBuffer += '		<div class="layui-input-inline">';
						   		strBuffer += coopEffectDiv.html();
						   		strBuffer += '		</div>';
						   		strBuffer += '	</div>';
								strBuffer += '	<div class="layui-inline">';
								strBuffer += '		<button type="button" class="layui-btn layui-btn-sm" id="addLinkBtn'+i+'" onclick="addRow(this);"><i class="layui-icon">&#xe654;</i></button>';
								if(i > 1){
									strBuffer += '		<button type="button" class="layui-btn layui-btn-sm" id="delLinkBtn'+i+'" onclick="deleteRow('+i+');"><i class="layui-icon">&#xe640;</i></button>';
								}
								strBuffer += '	</div>';
								strBuffer += '</div>';
								$('#coopDiv').append(strBuffer);
								$('#linkRow'+i).find('select[name=sgCoopId]').val(item.sgCoopId);
								$('#linkRow'+i).find('select[name=coopEffect]').val(item.coopEffect);
								form.render('select');
							}
				        });
					}
					//项目子项页面拼接
					if(inquiryPro.inquiryProSubs.length == 1){
						$('#commRow1').find('input[name=subName]').val(inquiryPro.inquiryProSubs[0].subName);
						$('#commRow1').find('input[name=subWorkYears]').val(inquiryPro.inquiryProSubs[0].workYears);
						$('#commRow1').find('input[name=subBuildYears]').val(inquiryPro.inquiryProSubs[0].buildYears);
						$('#commRow1').find('input[name=subOmYears]').val(inquiryPro.inquiryProSubs[0].omYears);
						$('#delCommBtn1').hide();
						var rowLength = $("div[id^='commRow']").length;
						if(rowLength > 1){
							$("div[id^='commRow']").each(function(){
								var tId = $(this).attr("id").substring(7);
								if(tId != '1'){
									$(this).remove();
								}
							});
						}
						form.render('select');
					}else{
						$('#subDiv').html('');
						layui.$.each(inquiryPro.inquiryProSubs, function(i,item){
							var ind = i + 1;
							var medalHtml = '';
							medalHtml += '<div id="commRow'+ind+'">';
							medalHtml += '	<div class="layui-form-item">';
							medalHtml += '	<div class="layui-inline width106">';
							medalHtml += '		<p class="right">子项<label>'+ind+'</label>：</p>';
							medalHtml += '		<input type="hidden" name="orderIdx" value="'+ind+'"/>';
							medalHtml += '	</div>';
							medalHtml += '	<div class="layui-inline">';
							medalHtml += '		<label class="layui-form-label width60">子项名称</label>';
							medalHtml += '		<div class="layui-input-inline" style="width:120px;">';
							medalHtml += '			<input type="text" name="subName" value="'+item.subName+'" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">';
							medalHtml += '		</div>';
							medalHtml += '	</div>';
							medalHtml += '	<div class="layui-inline">';
							medalHtml += '		<label class="layui-form-label width98">合作周期（年）</label>';
							medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
							medalHtml += '			<input type="text" name="subWorkYears" value="'+item.workYears+'" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
							medalHtml += '		</div>';
							medalHtml += '	</div>';
							medalHtml += '	<div class="layui-inline">';
							medalHtml += '		<label class="layui-form-label width98">建设周期（年）</label>';
							medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
							medalHtml += '			<input type="text" name="subBuildYears" value="'+item.buildYears+'" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
							medalHtml += '		</div>';
							medalHtml += '	</div>';
							medalHtml += '	<div class="layui-inline">';
							medalHtml += '		<label class="layui-form-label width98">运营周期（年）</label>';
							medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
							medalHtml += '			<input type="text" name="subOmYears" value="'+item.omYears+'" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
							medalHtml += '		</div>';
							medalHtml += '	</div>';
							medalHtml += '	<div class="layui-inline">';
							medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addCommBtn'+ind+'" onclick="addCommRow(this);"><i class="layui-icon">&#xe654;</i></button>';
							medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delCommBtn'+ind+'" onclick="deleteCommRow('+ind+');"><i class="layui-icon">&#xe640;</i></button>';
							medalHtml += '	</div>';
							medalHtml += '	</div>';
							medalHtml += '</div>';
							$('#subDiv').append(medalHtml);
						});
						form.render();
					}
					
					//获取回报机制复选框
					var backCheckbox = $("input[name=backMech]");
					backCheckbox.each(function(){
						if(inquiryPro.backMech.indexOf($(this).val()) != -1){
			            	$(this).prop('checked', true);
						}else{
			            	$(this).prop('checked', false);
						}
			         	form.render();
			         })
				}else{
					layer.msg('数据通信异常~',{icon: 0});
				}
			} 
		});
	});
  	
  	//项目渠道select监听
    form.on('select(add_selectFromChannel)', function(data){
    	var fromChannel = data.value;
    	if(fromChannel == '1'){
    		$("#linkPower").removeAttr("lay-verify");
    		$("#linkPowerDiv").hide();
    	}else{
    		$("#linkPower").attr("lay-verify","required");
    		$("#linkPowerDiv").show();
    	}
	});
  	
   	//监听提交
  	form.on('submit(addInfo_form_submit)', function(data){
  		var backMechCount = $('input[name=backMech]:checked').length;
  		if(backMechCount < 1){
  			layer.msg("回报机制至少选中一个",{icon: 0});
  			return;
  		}
  		if(backMechCount > 2){
  			layer.msg("回报机制最多选中两个",{icon: 0});
  			return;
  		}
  		//判断是否上传了标前承诺
  		if($("input[name=fileAtt31]").length < 1){
  			layer.msg("标前承诺未上传",{icon: 0});
  			return;
  		}
  		//判断是否上传了居间合同
  		if($("input[name=fileAtt32]").length < 1){
  			layer.msg("居间合同未上传",{icon: 0});
  			return;
  		}
  		//判断是否上传了PPP合同范本
  		if($("input[name=fileAtt38]").length < 1){
  			layer.msg("PPP合同范本未上传",{icon: 0});
  			return;
  		}
  		$("#addInfo_form_submit").removeAttr("lay-submit").removeClass("layui-bg-blue").addClass("layui-btn-disabled");
  		layer.load();
       	//提交 Ajax 成功后，静态更新表格中的数据
       	$.ajax({
           	type : 'post',
			url : basePath + '/deciPro/save',
           	data: $('#addInfo_form').serialize(),
			success:function(result){
				if(result.success){
					layer.closeAll('loading'); //关闭loading
					layer.msg('提交单据成功~',{icon: 1});
					//两秒后关闭当前页面
					setTimeout(function(){
						/**
						 * 查找父菜单，并刷新
						 */
						var topDoc = $(window.top.document);
						var path = basePath + '/deciPro/list';
						// 获取页面名称
						var name = topDoc.find(".layui-nav-item [lay-href^='" + path + "']").text();
						if(name == '' || name == null){
							name = '决策';
						}
						window.parent.layui.index.openTabsPage(path, name);
						var iframe = window.parent.layui.admin.tabsBody(window.parent.layui.admin.tabsPage.index).find(".layadmin-iframe");
						iframe[0].contentWindow.location.reload(true);
						
						/**
						 * 关闭当前页
						 */
						var currPath = basePath + '/deciPro/add';
						var layid = topDoc.find("li[lay-id^='" + currPath + "']").attr('lay-id');
						window.parent.layui.element.tabDelete('layadmin-layout-tabs', layid);//关闭当前页
				        }, 2000);
				}else{
					layer.closeAll('loading'); //关闭loading
  					$("#addInfo_form_submit").removeClass("layui-btn-disabled").addClass("layui-bg-blue").attr("lay-submit","");
					layer.msg(result.msg,{icon: 7});
			  	}
			}
       	});
   	});  
 	// data-type事件
    $('.layui-btn.layuiadmin-btn-admin').on('click', function(){
      var type = $(this).data('type');
      active[type] ? active[type].call(this) : '';
    });
  	
  });
  
	//新增联合体单位
	function addRow(t){
		var $ = layui.$;
		var thisid = $(t).attr("id").substring(10);
		thisid = $("div[id=linkRow" + thisid + "]").find("div:first").find("label").html();
		thisid = parseInt(thisid);
		var nextIndex = parseInt(thisid) + 1;
		var maxInd = $("div[id^='linkRow']").length;
		$("div[id^='linkRow']").each(function(){
			var tId = $(this).attr("id").substring(7);
			tId = parseInt(tId);
		  	if(tId > maxInd){
		  		maxInd = parseInt(tId);
		  	}
		  	var thisIndex = $(this).find("div:first").find("label").html();
		  	thisIndex = parseInt(thisIndex);
		  	var nextId = thisIndex + 1;
		  	if(thisIndex > thisid) {
		  		$("div[id=linkRow" + tId + "]").find("div:first").find("label").html(nextId);
		  	}
		});
		var ind = maxInd + 1;
		var sgCoopDiv = $("#sgCoopSelect").clone();
		var coopEffectDiv = $("#coopEffectSelect").clone();
		var medalHtml = '';
		medalHtml += '<div class="layui-form-item" id="linkRow'+ind+'">';
		medalHtml += '	<div class="layui-inline width106">';
		medalHtml += '		<p class="right">单位<label>'+nextIndex+'</label>：</p>';
		medalHtml += '		<input type="hidden" name="linkShowIndex" value="'+nextIndex+'"/>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label width60">单位名称</label>';
		medalHtml += '		<div class="layui-input-inline">';
   		medalHtml += sgCoopDiv.html();
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
   		medalHtml += '	<div class="layui-inline">';
   		medalHtml += '		<label class="layui-form-label">单位作用</label>';
   		medalHtml += '		<div class="layui-input-inline">';
   		medalHtml += coopEffectDiv.html();
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addLinkBtn'+ind+'" onclick="addRow(this);"><i class="layui-icon">&#xe654;</i></button>';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delLinkBtn'+ind+'" onclick="deleteRow('+ind+');"><i class="layui-icon">&#xe640;</i></button>';
		medalHtml += '	</div>';
		medalHtml += '</div>';
		$(t).parent().parent().after(medalHtml);
		layui.form.render();
	}
	
	//删除一行
	function deleteRow(id){
		var $ = layui.$;
		layui.layer.confirm('确定删除？',{icon:3, title :'提示'}, function(index){
 		   	var thisid = $("div[id=linkRow" + id + "]").find("div:first").find("label").html();
	    	thisid = parseInt(thisid);
	    	$("div[id^='linkRow']").each(function(){
				var tId = $(this).attr("id").substring(7);
				tId = parseInt(tId);
			  	var thisIndex = $("div[id=linkRow" + tId + "]").find("div:first").find("label").html();
			  	thisIndex = parseInt(thisIndex);
			  	var nextId = thisIndex - 1;
			  	if(thisIndex > thisid) {
			  		$("div[id=linkRow" + tId + "]").find("div:first").find("label").html(nextId);
			  	}
			});
	    	$("#linkRow"+id).remove();
			layui.layer.close(index);
 		});
	}
	
	//新增其他投标报价
	function addItemRow(t){
		var $ = layui.$;
		var delBtnCount = $("button[id^='delItemBtn']").length;
		if(delBtnCount == 1){
			$("button[id^='delItemBtn']").each(function(){
				$(this).removeAttr("style");
			});
		}
		var thisid = $(t).attr("id").substring(10);
		thisid = $("div[id=itemRow" + thisid + "]").find("div:first").find("label").html();
		thisid = parseInt(thisid);
		var nextIndex = parseInt(thisid) + 1;
		var maxInd = $("div[id^='itemRow']").length;
		$("div[id^='itemRow']").each(function(){
			var tId = $(this).attr("id").substring(7);
			tId = parseInt(tId);
		  	if(tId > maxInd){
		  		maxInd = parseInt(tId);
		  	}
		  	var thisIndex = $(this).find("div:first").find("label").html();
		  	thisIndex = parseInt(thisIndex);
		  	var nextId = thisIndex + 1;
		  	if(thisIndex > thisid) {
		  		$("div[id=itemRow" + tId + "]").find("div:first").find("label").html(nextId);
		  		$("div[id=itemRow" + tId + "]").find("div:first").find("input").val(nextId);
		  	}
		});
		var ind = maxInd + 1;
		var medalHtml = '';
		medalHtml += '<div class="layui-form-item" id="itemRow'+ind+'">';
		medalHtml += '	<div class="layui-inline width106">';
		medalHtml += '		<p class="right">其他报价<label>'+nextIndex+'</label>：</p>';
		medalHtml += '		<input type="hidden" name="itemOrderIdx" value="'+nextIndex+'"/>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label width60">报价指标</label>';
		medalHtml += '		<div class="layui-input-inline">';
   		medalHtml += '			<input type="text" name="itemName" maxlength="100" autocomplete="off" class="layui-input">';
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
   		medalHtml += '	<div class="layui-inline">';
   		medalHtml += '		<label class="layui-form-label">指标数据</label>';
   		medalHtml += '		<div class="layui-input-inline">';
   		medalHtml += '			<input type="text" name="itemPercent" maxlength="11" onblur="verify(this,\'number\')" autocomplete="off" class="layui-input">';
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addItemBtn'+ind+'" onclick="addItemRow(this);"><i class="layui-icon">&#xe654;</i></button>';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delItemBtn'+ind+'" onclick="deleteItemRow('+ind+');"><i class="layui-icon">&#xe640;</i></button>';
		medalHtml += '	</div>';
		medalHtml += '</div>';
		$(t).parent().parent().after(medalHtml);
		layui.form.render();
	}
	
	//删除其他投标报价一行
	function deleteItemRow(id){
		var $ = layui.$;
		layui.layer.confirm('确定删除？',{icon:3, title :'提示'}, function(index){
 		   	var thisid = $("div[id=itemRow" + id + "]").find("div:first").find("label").html();
	    	thisid = parseInt(thisid);
	    	$("div[id^='itemRow']").each(function(){
				var tId = $(this).attr("id").substring(7);
				tId = parseInt(tId);
			  	var thisIndex = $("div[id=itemRow" + tId + "]").find("div:first").find("label").html();
			  	thisIndex = parseInt(thisIndex);
			  	var nextId = thisIndex - 1;
			  	if(thisIndex > thisid) {
			  		$("div[id=itemRow" + tId + "]").find("div:first").find("label").html(nextId);
			  		$("div[id=itemRow" + tId + "]").find("div:first").find("input").val(nextId);
			  	}
			});
	    	$("#itemRow"+id).remove();
	    	var delBtnCount = $("button[id^='delItemBtn']").length;
			if(delBtnCount == 1){
				$("button[id^='delItemBtn']").each(function(){
					$(this).attr("style","display:none");
				});
			}
			layui.layer.close(index);
 		});
	}
	
	//新增子项
	function addCommRow(t){
		var $ = layui.$;
		var delBtnCount = $("button[id^='delCommBtn']").length;
		if(delBtnCount == 1){
			$("button[id^='delCommBtn']").each(function(){
				$(this).removeAttr("style");
			});
		}
		var thisid = $(t).attr("id").substring(10);
		thisid = $("div[id=commRow" + thisid + "]").find(".width106").find("label").html();
		thisid = parseInt(thisid);
		var nextIndex = parseInt(thisid) + 1;
		var maxInd = $("div[id^='commRow']").length;
		$("div[id^='commRow']").each(function(){
			var tId = $(this).attr("id").substring(7);
			tId = parseInt(tId);
		  	if(tId > maxInd){
		  		maxInd = parseInt(tId);
		  	}
		  	var thisIndex = $(this).find(".width106").find("label").html();
		  	thisIndex = parseInt(thisIndex);
		  	var nextId = thisIndex + 1;
		  	if(thisIndex > thisid) {
		  		$("div[id=commRow" + tId + "]").find(".width106").find("label").html(nextId);
		  		$("div[id=commRow" + tId + "]").find(".width106").find("input").val(nextId);
		  	}
		});
		var ind = maxInd + 1;
		var medalHtml = '';
		medalHtml += '<div id="commRow'+ind+'">';
		medalHtml += '	<div class="layui-form-item">';
		medalHtml += '	<div class="layui-inline width106">';
		medalHtml += '		<p class="right">子项<label>'+nextIndex+'</label>：</p>';
		medalHtml += '		<input type="hidden" name="orderIdx" value="'+nextIndex+'"/>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label width60">子项名称</label>';
		medalHtml += '		<div class="layui-input-inline" style="width:120px;">';
		medalHtml += '			<input type="text" name="subName" value="" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">';
		medalHtml += '		</div>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label width98">合作周期（年）</label>';
		medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
		medalHtml += '			<input type="text" name="subWorkYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
		medalHtml += '		</div>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label width98">建设周期（年）</label>';
		medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
		medalHtml += '			<input type="text" name="subBuildYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
		medalHtml += '		</div>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label width98">运营周期（年）</label>';
		medalHtml += '		<div class="layui-input-inline" style="width:98px;">';
		medalHtml += '			<input type="text" name="subOmYears" value="" maxlength="5" onblur="checkMaxValue(this);" lay-verify="required|number" autocomplete="off" class="layui-input">';
		medalHtml += '		</div>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addCommBtn'+ind+'" onclick="addCommRow(this);"><i class="layui-icon">&#xe654;</i></button>';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delCommBtn'+ind+'" onclick="deleteCommRow('+ind+');"><i class="layui-icon">&#xe640;</i></button>';
		medalHtml += '	</div>';
		medalHtml += '	</div>';
		medalHtml += '</div>';
		$(t).parent().parent().parent().after(medalHtml);
		layui.form.render();
	}
	
	//删除一行
	function deleteCommRow(id){
		var $ = layui.$;
		layui.layer.confirm('确定删除？',{icon:3, title :'提示'}, function(index){
 		    var rowLength = $("div[id^='commRow']").length;
 		   	var thisid = $("div[id=commRow" + id + "]").find(".width106").find("label").html();
	    	thisid = parseInt(thisid);
	    	$("div[id^='commRow']").each(function(){
				var tId = $(this).attr("id").substring(7);
				tId = parseInt(tId);
			  	var thisIndex = $("div[id=commRow" + tId + "]").find(".width106").find("label").html();
			  	thisIndex = parseInt(thisIndex);
			  	var nextId = thisIndex - 1;
			  	if(thisIndex > thisid) {
			  		$("div[id=commRow" + tId + "]").find(".width106").find("label").html(nextId);
			  		$("div[id=commRow" + tId + "]").find(".width106").find("input").val(nextId);
			  	}
			});
	    	$("#commRow"+id).remove();
	    	//剩下最后一行，删除按钮隐藏，input验证关闭
	    	var delBtnCount = $("button[id^='delCommBtn']").length;
			if(delBtnCount == 1){
				$("button[id^='delCommBtn']").each(function(){
					$(this).attr("style","display:none");
				});
			}
			layui.layer.close(index);
 		});
	}
  
	//删除文件
	function del(index){
		layui.$("#fileAtt_"+index).remove();
		layui.$("#upload_img_"+index).remove();
	}
  
	//根据url查看文件
	function showImg(url){
		var openWin = window.open(url,'','left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
	}
	
  	//计算子项最大值
	function checkMaxValue(obj){
  		if(obj.value == '' || obj.value == null){
  			return;
  		}
  		var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

		var boolrgx = rgx.test(obj.value);// true 
		if (!boolrgx) {
			obj.value =0;
			layer.msg('请输入正确数字，且保留两位小数！');
			return;
		}
  		var $ = layui.$;
  		var thisVal = parseFloat(obj.value);
  		var name = $(obj).attr("name");
  		var maxVal = thisVal;
  		if($("input[name="+name+"]").length > 1){
	  		$("input[name="+name+"]").each(function(){
				var tId = $(this).val();
				tId = parseFloat(tId).toFixed(2);
				if(tId > thisVal){
					maxVal = tId;
				}
			});
  		}
  		maxVal = parseFloat(maxVal).toFixed(2);
  		if(name == 'subWorkYears'){
  			$("input[name=workYears]").val(maxVal);
  		}else if(name == 'subBuildYears'){
  			$("input[name=buildYears]").val(maxVal);
  		}else if(name == 'subOmYears'){
  			$("input[name=omYears]").val(maxVal);
  		}
	}
  	
	//计算总投资额、建安工程总费用
	function calcSumAmount(){
		var $ = layui.$;
		var costCae = $("#costCae").val();
		var deviceCost = $("#deviceCost").val();
		var inReadyCost = $("#inReadyCost").val();
		var periodInterest = $("#periodInterest").val();
		var fluidCapital = $("#fluidCapital").val();
		var otherCost = $("#otherCost").val();
		var totalAmount = 0;
		var sumCae = 0;
		var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;
		
		if(costCae != '' && parseFloat(costCae) >= 0 && rgx.test(costCae)==true){
			totalAmount = parseFloat(totalAmount) + parseFloat(costCae);
			totalAmount = totalAmount.toFixed(2);
			sumCae = totalAmount;
		}else{
			costCae = 0;
			$("#costCae").val(0);
			totalAmount = parseFloat(totalAmount) + parseFloat(costCae);
			totalAmount = totalAmount.toFixed(2);
			sumCae = totalAmount;
			layer.msg('请输入正确数字，且保留两位小数！');
		}
		if(deviceCost != '' && parseFloat(deviceCost) >= 0&& rgx.test(deviceCost)==true){
			totalAmount = parseFloat(totalAmount) + parseFloat(deviceCost);
			totalAmount = totalAmount.toFixed(2);
			sumCae = totalAmount;
		}else{
			deviceCost = 0;
			$("#deviceCost").val(0);
			totalAmount = parseFloat(totalAmount) + parseFloat(deviceCost);
			totalAmount = totalAmount.toFixed(2);
			sumCae = totalAmount;
			layer.msg('请输入正确数字，且保留两位小数！');
		}
		if(inReadyCost != '' && parseFloat(inReadyCost) >= 0&& rgx.test(inReadyCost)==true){
			totalAmount = parseFloat(totalAmount) + parseFloat(inReadyCost);
			totalAmount = totalAmount.toFixed(2);
			sumCae = totalAmount;
		}else{
			inReadyCost = 0;
			$("#inReadyCost").val(0);
			totalAmount = parseFloat(totalAmount) + parseFloat(inReadyCost);
			totalAmount = totalAmount.toFixed(2);
			sumCae = totalAmount;
			layer.msg('请输入正确数字，且保留两位小数！');
		}
		if(periodInterest != '' && parseFloat(periodInterest) >= 0&& rgx.test(periodInterest)==true){
			totalAmount = parseFloat(totalAmount) + parseFloat(periodInterest);
			totalAmount = totalAmount.toFixed(2);
		}else{
			periodInterest = 0;
			$("#periodInterest").val(0);
			totalAmount = parseFloat(totalAmount) + parseFloat(periodInterest);
			totalAmount = totalAmount.toFixed(2);
			layer.msg('请输入正确数字，且保留两位小数！');
		}
		if(fluidCapital != '' && parseFloat(fluidCapital) >= 0&& rgx.test(fluidCapital)==true){
			totalAmount = parseFloat(totalAmount) + parseFloat(fluidCapital);
			totalAmount = totalAmount.toFixed(2);
		}else{
			fluidCapital = 0;
			$("#fluidCapital").val(0);
			totalAmount = parseFloat(totalAmount) + parseFloat(fluidCapital);
			totalAmount = totalAmount.toFixed(2);
			layer.msg('请输入正确数字，且保留两位小数！');
		}
		if(otherCost != '' && parseFloat(otherCost) >= 0&& rgx.test(otherCost)==true){
			totalAmount = parseFloat(totalAmount) + parseFloat(otherCost);
			totalAmount = totalAmount.toFixed(2);
		}else{
			otherCost = 0;
			$("#otherCost").val(0);
			totalAmount = parseFloat(totalAmount) + parseFloat(otherCost);
			totalAmount = totalAmount.toFixed(2);
			layer.msg('请输入正确数字，且保留两位小数！');
		}
		$("#sumAmount").val(totalAmount);
		$("#sumCae").val(sumCae);
	}
	
	//添加验证
  	function verify(obj,verType){
		var $ = layui.$;
		if(obj.value != null && obj.value != ''){
			$(obj).attr("lay-verify",verType);
		}else{
			$(obj).removeAttr("lay-verify");
		}
	}
  	//'请输入正确数字，且保留两位小数！'
	function isNumberAndFloat1(str) {
		var $ = layui.$, form = layui.form
		if (str.value == '' || str.value == null) {
			return;
		}
		var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

		var boolrgx = rgx.test(str.value);// true 
		if (boolrgx) {
			return true;
		} else {
			str.value =0;
			layer.msg('请输入正确数字，且保留两位小数！');
			return false;
		}
	}
  </script>
</body>
</html>

